package com.ruoyi.erp.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.erp.mapper.LedyBudgetMapper;
import com.ruoyi.erp.domain.LedyBudget;
import com.ruoyi.erp.service.ILedyBudgetService;

/**
 * 预算管理Service业务层处理
 * 
 * @author ztj
 * @date 2025-11-14
 */
@Service
public class LedyBudgetServiceImpl implements ILedyBudgetService 
{
    @Autowired
    private LedyBudgetMapper ledyBudgetMapper;

    /**
     * 查询预算管理
     * 
     * @param id 预算管理主键
     * @return 预算管理
     */
    @Override
    public LedyBudget selectLedyBudgetById(Long id)
    {
        return ledyBudgetMapper.selectLedyBudgetById(id);
    }
    @Override
    public List<LedyBudget> selectLedyBudgetByIds(Long[] ids)
    {
        return ledyBudgetMapper.selectLedyBudgetByIds(ids);
    }
    /**
     * 查询预算管理列表
     * 
     * @param ledyBudget 预算管理
     * @return 预算管理
     */
    @Override
    public List<LedyBudget> selectLedyBudgetList(LedyBudget ledyBudget)
    {
        return ledyBudgetMapper.selectLedyBudgetList(ledyBudget);
    }

    /**
     * 新增预算管理
     * 
     * @param ledyBudget 预算管理
     * @return 结果
     */
    @Override
    public int insertLedyBudget(LedyBudget ledyBudget)
    {
        ledyBudget.setCreateTime(DateUtils.getNowDate());
        return ledyBudgetMapper.insertLedyBudget(ledyBudget);
    }

    /**
     * 修改预算管理
     * 
     * @param ledyBudget 预算管理
     * @return 结果
     */
    @Override
    public int updateLedyBudget(LedyBudget ledyBudget)
    {
        ledyBudget.setUpdateTime(DateUtils.getNowDate());
        return ledyBudgetMapper.updateLedyBudget(ledyBudget);
    }

    /**
     * 批量删除预算管理
     * 
     * @param ids 需要删除的预算管理主键
     * @return 结果
     */
    @Override
    public int deleteLedyBudgetByIds(Long[] ids)
    {
        return ledyBudgetMapper.deleteLedyBudgetByIds(ids);
    }

    /**
     * 删除预算管理信息
     * 
     * @param id 预算管理主键
     * @return 结果
     */
    @Override
    public int deleteLedyBudgetById(Long id)
    {
        return ledyBudgetMapper.deleteLedyBudgetById(id);
    }
}
